/**
 * Copyright © 2022 易久批信息技术有限公司. All rights reserved.
 */
package com.dysm.pc;

import java.util.concurrent.CopyOnWriteArrayList;

/**
 *
 * @author xiay
 * @since 2022/4/6 8:02 下午
 */
public class PCTest {

    public static void main(String[] args) {
//        BlockingQueue<Integer> queue = new ArrayBlockingQueue<>(100);
//
//        new Thread(new BlockQueueProducer(queue), "p1").start();
//        new Thread(new BlockQueueConsumer(queue), "c1").start();
//        new Thread(new BlockQueueConsumer(queue), "c2").start();

        CopyOnWriteArrayList<Integer> list = new CopyOnWriteArrayList<>();

        new Thread(new WaitProducer(list), "p1").start();
        new Thread(new WaitProducer(list), "p2").start();
        new Thread(new WaitConsumer(list), "c1").start();
        new Thread(new WaitConsumer(list), "c2").start();
    }
}
